<template>
  <!-- 头部部分 -->
  <header class="header">
    <h1>todos</h1>
    <input
      class="new-todo"
      placeholder="请输入任务名称"
      @keyup.enter="AddItem"
      autofocus
    />
  </header>
</template>

<script>
export default {
  
  data() {
    return {
    };
  },
  methods: {
    AddItem(e) {
   this.$emit("AddItem", { id: +new Date(), name: e.target.value, flag: false, },
   e.target.value=''
);
    },
  },
};
</script>

<style></style>
